package com.pig4cloud.pigx.common.customize.utils;

import com.pig4cloud.pigx.common.customize.contants.RegexConstants;
import org.springframework.stereotype.Component;

/**
 * 正则表达式工具类
 *
 * @since 2022/11/3 13:57
 */
@Component
public class RegexUtil {

	/**
	 * 校验ip地址格式
	 *
	 * @param ip ip
	 * @return {@link boolean}
	 * @since 2022/11/3 13:58
	 */
	public static boolean ip(String ip) {
		return RegexConstants.IP.matcher(ip).matches();
	}
}
